﻿using System;
using System.Xml.Schema;
using System.Xml.Serialization;
using flickr.api.communication;

namespace flickr.api
{
	[Serializable]
	public class Blogs : FlickrObject
	{
		[XmlElement("blog", Form=XmlSchemaForm.Unqualified)]
		public Blog[] BlogCollection;
	    
	    public Blogs() : base() {}
	    public Blogs(FlickrConnection connection) : base(connection){}
	    
	    public Blogs getList()
	    {
            FlickrRequest request = CreateRequest();
            return Send(request).Blogs;
	    }
	    
	    public void postPhoto(string blogId, string blogPassword, string title, string description, string photoId)
	    {
            FlickrRequest request = CreateRequest();
	        request.AddParameter(FlickrParameterType.BlogId, blogId);
	        request.AddParameter(FlickrParameterType.BlogPassword, blogPassword);
	        request.AddParameter(FlickrParameterType.Title, title);
	        request.AddParameter(FlickrParameterType.Description, description);
	        request.AddParameter(FlickrParameterType.PhotoId, photoId);

            Send(request);
	    }
	}
}